package com.example.runningball.figures;

import android.graphics.Canvas;

public class Corner {
	
	public float x;
	public float y;
	public float speed = 1;
	
	public Corner(float x, float y) {
		this(x, y, 1);
	}
	
	public Corner(float x, float y, float speed) {
		this.x = x;
		this.y = y;
		this.speed = speed;
	}
	
	public void moveUp() {
		y -= speed;
	}
	
	public void moveDown() {
		y += speed;
	}
	
	public void moveRight() {
		x += speed;
	}
	
	public void moveLeft() {
		x += speed;
	}
	
	public boolean isOutOfScreenUp() {
		return x < 0 || y < 0;
	}
	
	public boolean isOutOfScreenDown(Canvas canvas) {
		return x > canvas.getWidth() - 1 || y > canvas.getHeight() - 1;
	}
}
